import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
    path: '/main',
    name: 'main',
    component: () =>
        import('../views/element/elementView.vue')
}, {
    path: '/login',
    name: 'login',
    component: () =>
        import('../views/element/login.vue')
},
{
    path: '/',
    name: 'main',
    component: () =>
        import('../views/element/elementView.vue')
},
{
    path: '/userView',
    name: 'userView',
    component: () =>
        import('../views/element/userView.vue')
}, {
    path: '/register',
    name: 'register',
    component: () =>
        import('../views/element/register.vue')
}, {
    path: '/postPage/:backPage',
    name: 'postPage',
    component: () =>
        import('../views/element/postPage.vue')
}, {
    path: '/userInformation/:userId&:userName&:backPage',
    name: 'userInformation',
    component: () =>
        import('../views/element/userInformation.vue')
}, {
    path: '/searchPage/:value&:backPage',
    name: 'searchPage',
    component: () =>
        import('../views/element/searchPage.vue')
}, {
    path: '/adminMain/:userId&:userName&:userId&:userName',
    name: 'adminMain',
    component: () =>
        import('../views/element/elementViewAdmin.vue')
}, {
    path: '/SearchPageAdmin',
    name: 'SearchPageAdmin',
    component: () =>
        import('../views/element/SearchPageAdmin.vue')
}, {
    path: '/post/:id',
    name: 'postDatail',
    component: () =>
        import('../views/element/postDetail.vue')
}, {
    path: '/post/edit',
    name: 'postPage',
    component: () =>
        import('../views/element/postPage.vue')
}, {
    path: '/afterLogin/:userId&:userName',
    name: 'afterLogin',
    component: () =>
        import('../views/element/afterLoginElementView.vue')
}, {
    path: '/postDetail',
    name: 'postDetail',
    component: () =>
        import('../views/element/postDetail.vue')
}, {
    path: '/showPost/:postId&:userId&:userName&:backPage',
    name: 'showPost',
    component: () =>
        import('../views/element/showPost.vue')
}, {
    path: '/updatePost/:postId&:userId&:userName',
    name: 'updatePost',
    component: () =>
        import('../views/element/updatePost.vue')
}, {
    path: '/adminChargeUser/:userId&:userName',
    name: 'adminChargeUser',
    component: () =>
        import('../views/element/AdminChargeUser.vue')
}
]

const router = new VueRouter({
    routes
})

export default router